
import Strategy.*;

public class Main {
    public static void main(String[] args) {

        System.out.println("开始测试策略模式");
        Context context = new Context();

        Strategy strategyA = new ConcreteStrategyA();
        Strategy strategyB = new ConcreteStrategyA();

        context.setStrategy(strategyA);
        context.algorithm();

        context.setStrategy(strategyB);
        context.algorithm();

    }
}